package com.course01.orderbackend.exception;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;


@Getter
public class ValidationException extends RuntimeException{
    Map<String,String> errors =new HashMap<>();

    public ValidationException(){
        super();
    }
    public ValidationException(String message){
        super(message);
        this.errors=null;
    }
    public ValidationException(String message,Map<String,String>errors){
        super(message);
        this.errors=errors;
    }
    // 手动添加getter方法（核心解决步骤）
    public Map<String, String> getErrors() {
        return errors;
    }

}
